Configuring PLC within PLC-object
How to configure the →PLC resp. how to define which PLC should be used when loading your application:
-
Open a PLC-object.
-
In the opened editor for the PLC-object, search for the lines starting with
CHANNEL
and ending withEND_CHANNEL
:Syntax in case of communication with target system via TCP/IP {
CHANNEL channel-name
TCP
ADDRESS := address;
PORT := 1534;
END_TCP
END_CHANNEL
}
Example for definitions in PLC-object "local" {
CHANNEL LocalChannel
TCP
ADDRESS := 127.0.0.1;
PORT := 1534;
END_TCP
END_CHANNEL
}
After you have created a project, usually there are already some settings specified for the PLC within the existing PLC-object (information about the possible definitions are listed under "Errors while editing PLC-object in editor, Correct syntax for PLC-object").
-
Replace the definition for the IP-address by the corresponding data for your PLC.
-
Search for the following line in the editor:
Syntax RESOURCE resource-name ON platform-name { ON_CHANNEL := channel-name }
Example for definitions in PLC-object "local" RESOURCE local ON BuiltInPlc { ON_CHANNEL := LocalChannel }
-
Make sure that in this line behind
ON_CHANNEL
the same name is entered as entered inCHANNEL ... END_CHANNEL
.
When loading the application for the example, the PLC under IP-address127.0.0.1
is addressed. -
If no platform is entered in the PLC-object, select one by using the content assist (in line
RESOURCE ...
behindON
). All available platforms are listed under "Available platforms". -
Save the PLC-object: menu File – Save
Available platforms
At present, the following platforms are available:
Platform |
Use this platform, if you want to load the application on the following PLC. |
entered within this existing PLC-object |
---|---|---|
|
on the local computer |
within |
|
on a Linux PC |
– |
|
on a Windows PC |
– |
More platforms might be provided in your version.
For instance, the following platforms are provided for the respective target system:
Platform |
Use this platform, if you want to load the application on the following PLC. |
entered within this existing PLC-object |
---|---|---|
|
on an →Arduino Nano |
within |
|
on a respective →Controllino |
within |
|
on a →Revolution Pi |
within |
|
on a →phyBOARD-Regor
|
within |
|
on a →phyBOARD-Wega |
within |
|
on a →Raspberry Pi |
within |
Several PLC-configurations to quickly change the PLC-configuration
If you want to quickly address a different PLC when loading, you might want to consider providing several PLC-configurations.
How to provide several PLC-configurations
-
In the PLC-object, copy all lines starting with {
CHANNEL
untilEND_CHANNEL
}. -
Paste the copied lines into the editor for the PLC-object, to be specific after the existing line
}
but before lineCONFIGURATION configuration-name
. -
In the pasted lines, enter a unique
Channel
name and adjust the copied definitions to the ones required for your PLC.
Result: 2 PLC-configurations are available within the editor.Example {
CHANNEL Channel1
TCP
ADDRESS := 127.0.0.1;
PORT := 1534;
END_TCP
END_CHANNEL
}
{
CHANNEL Channel2
TCP
ADDRESS := 192.168.1.194;
PORT := 1534;
END_TCP
END_CHANNEL
}
-
Search for the following line in the editor:
Syntax RESOURCE resource-name ON platform-name { ON_CHANNEL := channel-name }
Example RESOURCE local ON BuiltInPlc { ON_CHANNEL := Channel1 }
-
Replace the entered
Channel
name (e.g.Channel1
) by theChannel
name previously entered (e.g.Channel2
) so that the other PLC is being addressed when loading the application forlocal
. -
Save the PLC-object: menu File – Save
If you want to address the other PLC when loading, you only have to change the name behind ON_CHANNEL
in the editor for the PLC-object.